package com.unitd.frame.comm.bean;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.io.Serializable;

/**
 * @desc 系统所有自定义的实体类的公共基类, 用于序列化
 * @filename BaseBean.java
 * @copyright www.unitd.com
 * @author Hudan
 * @version 1.0
 * @date 2017/8/18
 */
public abstract class BaseBean implements Serializable, Cloneable {

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}

	@Override
	public boolean equals(Object o) {
		return EqualsBuilder.reflectionEquals(this, o);
	}

	@Override
	public int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

	@Override
	public Object clone() throws CloneNotSupportedException {
		return super.clone();
	}
}